package com.kmust.dream.wanderingdream.product.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName product_property_value
 */
@TableName(value ="product_property_value")
@Data
public class ProductPropertyValue implements Serializable {
    /**
     * 商品属性值id
     */
    @TableId(value = "product_property_value_id", type = IdType.AUTO)
    private Integer productPropertyValueId;

    /**
     * 商品属性id，实为外键，方便不设
     */
    @TableField(value = "product_property_name_id")
    private Integer productPropertyNameId;

    /**
     * 商品属性值
     */
    @TableField(value = "product_property_value")
    private String productPropertyValue;

    /**
     * 商品值图片url
     */
    @TableField(value = "product_property_image")
    private String productPropertyImage;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProductPropertyValue other = (ProductPropertyValue) that;
        return (this.getProductPropertyValueId() == null ? other.getProductPropertyValueId() == null : this.getProductPropertyValueId().equals(other.getProductPropertyValueId()))
            && (this.getProductPropertyNameId() == null ? other.getProductPropertyNameId() == null : this.getProductPropertyNameId().equals(other.getProductPropertyNameId()))
            && (this.getProductPropertyValue() == null ? other.getProductPropertyValue() == null : this.getProductPropertyValue().equals(other.getProductPropertyValue()))
            && (this.getProductPropertyImage() == null ? other.getProductPropertyImage() == null : this.getProductPropertyImage().equals(other.getProductPropertyImage()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getProductPropertyValueId() == null) ? 0 : getProductPropertyValueId().hashCode());
        result = prime * result + ((getProductPropertyNameId() == null) ? 0 : getProductPropertyNameId().hashCode());
        result = prime * result + ((getProductPropertyValue() == null) ? 0 : getProductPropertyValue().hashCode());
        result = prime * result + ((getProductPropertyImage() == null) ? 0 : getProductPropertyImage().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", productPropertyValueId=").append(productPropertyValueId);
        sb.append(", productPropertyNameId=").append(productPropertyNameId);
        sb.append(", productPropertyValue=").append(productPropertyValue);
        sb.append(", productPropertyImage=").append(productPropertyImage);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}